package edu.psu.geovista.app.pcp;


import edu.psu.geovista.app.pcp.event.PcpSelectionEvent;
import edu.psu.geovista.app.pcp.light.LightPcp;
import edu.psu.geovista.app.pcp.plot.control.Settings;
import edu.psu.geovista.app.pcp.plot.services.ExternalService;
import edu.psu.geovista.app.plot.MMPlot;
import edu.psu.geovista.app.plot.axis.YAxis;
import edu.psu.geovista.data.model.AppDataModel;

import java.awt.*;

/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 *
 * @author: jin Chen 
 * @date: Jan 23, 2005$
 * @version: 1.0
 */

public interface Pcp extends MMPlot{
    //public static final Color DEFAULT_DATA_COLOR=new Color(200,200,200);//for init purpose
    public static final int  barOffset=65;//offset resulted from toolbar and slider bar
    //public static final Point xaxisOffset=new Point(0,40);   // xaxis offset on horizontal(X) and vertical(Y) direction
    /*******************************************************************************************************
     *                Funtions
     *******************************************************************************************************/
    /**
     * show only the specified axes in the plot
     * @param names    axes' name
     */
    public void setValidYAxes(String [] names);
    //auto fit the plot
    public void fitwindow();
    public  YAxis generateYAxis(String columnName);


    /*******************************************************************************************************
     *                Data & Model
     *
     *******************************************************************************************************/
    // set data
    public void setData(Object[] rawData) ;
    public void setDataModel(AppDataModel dataModel);
    public AppDataModel getDataModel();
    public Object[] getRawData();

    //public XAxisOrder getXaxis();
    //public AxisList getYaxisList();


    /*******************************************************************************************************
     *                Utilities
     *******************************************************************************************************/

   
    /**
     * create a light component for the Master component. The light component should be a light copy of it master component, with same look & feel
     *  
     * @return
     */
    public  LightPcp createLightComponent();
    public Settings getSettings();

    public ExternalService getExternalService() ;
    public void setExternalService(ExternalService externalService);
    /*******************************************************************************************************
     *                GUI
     *******************************************************************************************************/
    //Height of YAxis
    public int getDefaultYaxisSize();
     /**
     * set size, only positive size will be affect
     * @param w  if <0, ignore it
     * @param h  if <0, ignore it
     */
    public void setPositiveSize(int w, int h) ;
    /**
     * height= YAxis's activeSize
     * width=XAxis's activeSize
     * @return
     */
    public Dimension getActiveSize();
     public Dimension getPlotSize();
    public int getBarOffset();
    //public Point getOffset();
    //public Point getXaxisOffset();
    /**
     * set the plot size according to Y/X axes's activesize
     */
    public void setBound();
    //set Xaxis's location
    public  void setXaxisLocation();
    /*******************************************************************************************************
     *                Events
     *******************************************************************************************************/
      /**
     * Notify all listeners that have registered interest for
     * notification on this event type. The event instance
     * is lazily created using the parameters passed into
     * the fire method.
     * @see javax.swing.event.EventListenerList
     */
	public  void fireIndicationChanged (int indicator);
    public void fireColorArrayChanged(Color[] colors);
    public  void fireSelectionChanged (int[] newSelection, int mode) ;
    /**
     * Notify all listeners that have registered interest for
     * notification on this event type. The event instance
     * is lazily created using the parameters passed into
     * the fire method.
     * @see javax.swing.event.EventListenerList
     */
    public  void fireSelectionChanged (PcpSelectionEvent evt);
    /*******************************************************************************************************
     *                TEMP
     *******************************************************************************************************/
     //todo, temp, need to remove -->
     public boolean isStandAlone();
     public void setStandAlone(boolean standAlone);
    public int getMode();
    public void setMode(int mode);
     //todo, temp, need to remove <--
}
